[DebugInfo] Use heterogenous lookups with std::map (NFC)#113118
Merged
kazutakahirata merged 1 commit intollvm:mainfrom Oct 21, 2024
Merged
[DebugInfo] Use heterogenous lookups with std::map (NFC)#113118kazutakahirata merged 1 commit intollvm:mainfrom
kazutakahirata merged 1 commit intollvm:mainfrom
Conversation
Member
|
@llvm/pr-subscribers-debuginfo Author: Kazu Hirata (kazutakahirata) ChangesFull diff: https://github.com/llvm/llvm-project/pull/113118.diff 2 Files Affected:
diff --git a/llvm/include/llvm/DebugInfo/LogicalView/Readers/LVBinaryReader.h b/llvm/include/llvm/DebugInfo/LogicalView/Readers/LVBinaryReader.h
index f76f2ecd3e2121..9cda64e33ddf74 100644
--- a/llvm/include/llvm/DebugInfo/LogicalView/Readers/LVBinaryReader.h
+++ b/llvm/include/llvm/DebugInfo/LogicalView/Readers/LVBinaryReader.h
@@ -47,7 +47,7 @@ struct LVSymbolTableEntry final {
// Function names extracted from the object symbol table.
class LVSymbolTable final {
- using LVSymbolNames = std::map<std::string, LVSymbolTableEntry>;
+ using LVSymbolNames = std::map<std::string, LVSymbolTableEntry, std::less<>>;
LVSymbolNames SymbolNames;
public:
diff --git a/llvm/lib/DebugInfo/LogicalView/Readers/LVBinaryReader.cpp b/llvm/lib/DebugInfo/LogicalView/Readers/LVBinaryReader.cpp
index c45f0e91c43589..932346e1b011bf 100644
--- a/llvm/lib/DebugInfo/LogicalView/Readers/LVBinaryReader.cpp
+++ b/llvm/lib/DebugInfo/LogicalView/Readers/LVBinaryReader.cpp
@@ -87,20 +87,20 @@ LVSectionIndex LVSymbolTable::update(LVScope *Function) {
const LVSymbolTableEntry &LVSymbolTable::getEntry(StringRef Name) {
static LVSymbolTableEntry Empty = LVSymbolTableEntry();
- LVSymbolNames::iterator Iter = SymbolNames.find(std::string(Name));
+ LVSymbolNames::iterator Iter = SymbolNames.find(Name);
return Iter != SymbolNames.end() ? Iter->second : Empty;
}
LVAddress LVSymbolTable::getAddress(StringRef Name) {
- LVSymbolNames::iterator Iter = SymbolNames.find(std::string(Name));
+ LVSymbolNames::iterator Iter = SymbolNames.find(Name);
return Iter != SymbolNames.end() ? Iter->second.Address : 0;
}
LVSectionIndex LVSymbolTable::getIndex(StringRef Name) {
- LVSymbolNames::iterator Iter = SymbolNames.find(std::string(Name));
+ LVSymbolNames::iterator Iter = SymbolNames.find(Name);
return Iter != SymbolNames.end() ? Iter->second.SectionIndex
: getReader().getDotTextSectionIndex();
}
bool LVSymbolTable::getIsComdat(StringRef Name) {
- LVSymbolNames::iterator Iter = SymbolNames.find(std::string(Name));
+ LVSymbolNames::iterator Iter = SymbolNames.find(Name);
return Iter != SymbolNames.end() ? Iter->second.IsComdat : false;
}
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.